import { ProFileType } from '@/store/reducers/user';
import request from '@/utils/request';
// 发送验证码

export const getUserApi = () => {
  return request({
    url: '/v1_0/user',
  });
};
export const getProfileEditApi = () => {
  return request({
    url: '/v1_0/user/profile',
  });
};
// 上传图片
export const updatePhotoAPI = (data: FormData) => {
  return request({
    url: '/v1_0/user/photo',
    method: 'patch',
    data,
  });
};

// 定义api
// 封装异步action
// 调用dispatch

// 修改性别
export const updateProfileAPI = (data: Partial<ProFileType>) => {
  return request({
    url: '/v1_0/user/profile',
    method: 'patch',
    data,
  });
};
